package com.lxf.cloudproduct.mapper;

import com.lxf.cloudproduct.bean.ProductBean;
import com.lxf.cloudproduct.bean.ProductImgBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 罗兴发
 * @data 2025/5/9 9:56
 * @description：商品持久层
 */
@Mapper
public interface ProductMapper {
    int addProduct(@Param("list") List<ProductBean> list);
    ProductBean getProductByCode(@Param("goodCode") String goodCode);
    List<ProductBean> getProduct();
    int updateProductNumByCode(@Param("userId") Integer userId,
                               @Param("pCode") String pCode,
                               @Param("pNum") Integer pNum,
                               @Param("isUp") Integer isUp);
    int deleteProductByCode(@Param("list") List<String> list);

    int addProductImg(@Param("list") List<ProductImgBean> list);

    int deleteProductImgByCode(@Param("goodCode") String goodCode);

    List<ProductImgBean> getProductImgByCode(@Param("goodCode") String goodCode);

    List<ProductBean> findAllByGoodCodeIn(@Param("list") List<String> list);

    List<ProductBean> findAllByCLR(@Param("num") Integer num);
}
